package wolfcode.mq;

import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @Author: 普发忠
 * @Date: 2021/11/07/9:53
 */
@Component
@RocketMQMessageListener(
        topic = "01-boot-topic",
        consumerGroup = "wolfcode-consumer1",
        messageModel = MessageModel.BROADCASTING,
        selectorType = SelectorType.SQL92,
//        selectorExpression = "TagA"
        selectorExpression = "age>18"
)
public class RockMQListener implements RocketMQListener<String> {
    @Override
    public void onMessage(String s) {
        System.out.println("芜湖1111111"+s);
    }
}
